package com.yhx.testDemo;

import com.yhx.security.gfoBank.file.DataConvertUtils;
import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;

/**
 * @author: mishuai
 * @date: 2021/2/1 15:15
 * @description:
 */
public class YaTou2 {


    public static void main(String[] args) {
        List<Object> ll = ExcelImportUtil.importExcel("D:\\我的文档\\基因名称.xlsx", IdAndName.class);

        boolean b=false;
        List<IdAndName> idAndNames=new ArrayList<>();
        if(ll !=null && ll.size()>0){
            for(Object o:ll) {
                IdAndName id = (IdAndName)o;
                idAndNames.add(id);
            }
            System.out.println(FastJsonUtils.toJSONString(ll));

        // ComparatorList comparatorList=new ComparatorList();
        // Collections.sort(shopAddressInfos,comparatorList);

      //  ExcelExportUtil.exportToFile("D:\\我的文档\\a88.xlsx",shopAddressInfos);
        }

        List<Object> huizong = ExcelImportUtil.importExcel("D:\\我的文档\\ww.xlsx", Huizong.class);
        List<Huizong> huizongs=new ArrayList<>();
        for(Object hui:huizong){
            if(hui == null){
               continue;
            }
            Huizong id = (Huizong)hui;
            if(id == null || StringUtils.isBlank(id.getSeq_1())){
                continue;
            }
            for(IdAndName idAndName:idAndNames){
                if(idAndName == null){
                    continue;
                }
                if(id.getSeq_1().equalsIgnoreCase(idAndName.getId())){
                    id.setName2(idAndName.getName());
                }
            }
            huizongs.add(id);
        }
        ExcelExportUtil.exportToFile("D:\\我的文档\\huizong3.xlsx",huizongs);

    }

}
